﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using System.Globalization;

namespace RestServiceDayOfWeek
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "SubstringOccurrencesService" in code, svc and config file together.
    public class DayOfWeekBgService : IDayOfWeekBg
    {
        public string GetDay(string date)
        {
            CultureInfo cultureUsed = new CultureInfo("Bg-bg");
            DateTime parsed = DateTime.ParseExact(date,"dd-MM-yyyy",cultureUsed);
            string result;
            CultureInfo bulgarian = new CultureInfo("BG-bg");
            result = bulgarian.DateTimeFormat.DayNames[(int)parsed.DayOfWeek];
            return result;
        }
    }
}
